package com.tao.factorys;

import com.tao.pojo.Submittable;
import com.tao.pojo.Submittable;
import com.tao.utils.UUIDUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.UUID;

/**
 * @Author: alubus
 * @Date: 2021/11/12 17:04
 * @Package: com.tao.factorys
 */
@Component
public class SubmittableFactory {
@Autowired
    UUIDUtils uuidUtils;

    public Submittable getSubmittable( Long qid,Long aid,String Content){
        Submittable submittable = new Submittable();
//        submittable.setId(Long.valueOf(uuidUtils.getUUID(12)));
        submittable.setQid(qid);
        submittable.setAid(aid);
        submittable.setContent(Content);
        submittable.setRank(10);
        submittable.setStatus(0);
        submittable.setSubmittime(new Date());
        return submittable;
    };

    public Submittable getSubmittable(@RequestParam Long qid, @RequestParam Long aid){

        return this.getSubmittable(qid,aid,"测试数据");
    };

    public Submittable getSubmittable(Long qid){

        return this.getSubmittable(qid,999L);
    };

    public Submittable getSubmittable(){
        return this.getSubmittable(666L);
    };


}
